package org.jground.rx.def.apps.ipm;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
@SuppressWarnings("unused")
public class Imitation extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.ipm.Imitation";

    private static final String copiedProduct ="copiedProduct";
    private static final String priceOfImitation ="priceOfImitation";
    private static final String descriptionOfImitation ="descriptionOfImitation";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String copiedProduct ="copiedProduct";
        public static final String priceOfImitation ="priceOfImitation";
        public static final String descriptionOfImitation ="descriptionOfImitation";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Imitation createNew() { return new Imitation(RXObjectService.getInstance().create(moid)); }

    public static Imitation getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Imitation(mod);
    }

    public static Imitation[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Imitation[] res = new Imitation[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Imitation(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Imitation[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Imitation[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Imitation[] res = new Imitation[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Imitation(mod);
            i++;
        }
        return res;
    }

    public static Imitation wrap(IRXObjectSynopsis mod) { 
        return new Imitation(mod);
    }

    private Imitation(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getCopiedProductLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, copiedProduct).getLabel();
    }

    public static String getCopiedProductDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, copiedProduct).getDescription();
    }

    public void setCopiedProduct(org.jground.rx.def.apps.cip.Product value) {
        rxObject.set(copiedProduct, _to_String(value));
    }

    public org.jground.rx.def.apps.cip.Product getCopiedProduct() {
        return org.jground.rx.def.apps.cip.Product.getById(rxObject.getCurrentValue(copiedProduct));
    }

    public static String getPriceOfImitationLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, priceOfImitation).getLabel();
    }

    public static String getPriceOfImitationDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, priceOfImitation).getDescription();
    }

    public void setPriceOfImitation(Currency currency) {
        rxObject.set(priceOfImitation, _to_String(currency));
    }

    public Currency getPriceOfImitation() {
        return _to_Currency(rxObject.getValues(priceOfImitation));
    }

    public static String getDescriptionOfImitationLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, descriptionOfImitation).getLabel();
    }

    public static String getDescriptionOfImitationDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, descriptionOfImitation).getDescription();
    }

    public void setDescriptionOfImitation(String text) {
        rxObject.set(descriptionOfImitation, _to_String(text));
    }

    public String getDescriptionOfImitation() {
        return _to_String(rxObject.getCurrentValue(descriptionOfImitation));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
